package br.com.traffic.help.controle;

import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.traffic.help.dao.HelpDAO;
import br.com.traffic.help.model.Conteudo;
import br.com.traffic.help.model.Contexto;
import br.com.traffic.help.model.Unidade;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * Servlet implementation class ControleReferencia
 */
public class ControleReferencia extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ControleReferencia() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		processarRequest(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		processarRequest(request, response);
	}
	
	protected void processarRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		

		Gson gson = new Gson();
		
		Conteudo conteudo = new Conteudo();
		
		conteudo.setRotulo("teste funcionou");
		
				
		
		response.setContentType("text/;charset=UTF-8");
        PrintWriter out = response.getWriter();
        
        System.out.println(gson.toJson(conteudo));
        
        out.println(gson.toJson(conteudo));
		
		
	
	}

}
